package com.basic.modules.ykf.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.basic.common.utils.ParamsModel;
import com.basic.common.utils.ParamUtils;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.basic.common.utils.PageUtils;
import com.basic.common.utils.Query;
import com.basic.modules.ykf.dao.YkfSubAccountModifyRecordDao;
import com.basic.modules.ykf.entity.YkfSubAccountModifyRecordEntity;
import com.basic.modules.ykf.service.YkfSubAccountModifyRecordService;


@Service("ykfSubAccountModifyRecordService")
public class YkfSubAccountModifyRecordServiceImpl extends ServiceImpl<YkfSubAccountModifyRecordDao, YkfSubAccountModifyRecordEntity> implements YkfSubAccountModifyRecordService {

    @Override
    public PageUtils queryPage(ParamsModel<YkfSubAccountModifyRecordEntity> params) {
        QueryWrapper<YkfSubAccountModifyRecordEntity> queryWrapper = ParamUtils.createQueryWrapperByDefaultSort(params);
        IPage<YkfSubAccountModifyRecordEntity> page = this.page(
                new Query<YkfSubAccountModifyRecordEntity>().getPage(BeanUtil.beanToMap(params.getPage())),
                queryWrapper
        );
        return new PageUtils(page);
    }
}